# $Id$
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=gnome-online-accounts
pkgver=3.26.1
pkgrel=1
pkgdesc="Single sign-on framework for GNOME"
url="https://wiki.gnome.org/Projects/GnomeOnlineAccounts"
arch=(i686 x86_64)
license=(LGPL)
depends=(webkit2gtk json-glib libnotify rest libsecret telepathy-glib krb5 gcr)
makedepends=(intltool gobject-introspection gtk-doc vala git gnome-common)
optdepends=('gvfs-goa: Virtual file systems (e.g. OwnCloud)'
            'gvfs-google: Google Drive')
_commit=b36db9948f24637c37c6485a129757498454c5ea  # tags/3.26.1^0
source=("git+https://git.gnome.org/browse/gnome-online-accounts#commit=$_commit"
        "git+https://git.gnome.org/browse/telepathy-account-widgets")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.telepathy-account-widgets.url "$srcdir/telepathy-account-widgets"
  git submodule update

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname

  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib/$pkgname \
    --disable-static \
    --enable-inspector \
    --enable-media-server \
    --enable-kerberos \
    --enable-lastfm \
    --enable-todoist \
    --enable-gtk-doc

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
